<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    console.log(Math.ceil(1.1));//2
    console.log(Math.floor(1.9));//1.txt
    console.log(Math.round(1.1));//1.txt
    console.log(Math.round(1.9));//2
    console.log(Math.fround(1.1));//1.txt.100000023841858
    console.log(Math.fround(1.9));//1.txt.899999976158142
    console.log(0.5 + 2.5);
    console.log(1.5 + 1.5);

    let a = 0.1, b = 0.2;
    console.log(a + b);
    console.log(0.05 + 0.25);

    let uri = encodeURI("http://www.leo.com/你好.html#start");
    console.log(uri);
    console.log(encodeURIComponent("http://www.leo.com/你好.html#start"));

    // "use strict"
    let msg = "hello world";
    eval("console.log(msg)"); // "hello world"
    // let eval = "haha";//严格模式不能以eval做为变量

    let st1 = setTimeout(function () {
        //异步的体现
        document.write(new Date());
    }, 2000);//1秒之后执行回调函数中的代码
    console.log("执行完毕");
    clearTimeout(st1);
    /*
        同步：代码在同一步线上执行，如果中间卡住，则后面的代码一直等待
        异步：代码分不同的线执行，相互不干扰
     */

    let si = setInterval(function () {
        document.write(new Date());
    }, 1000);
    setTimeout(function () {
        clearInterval(si);
    }, 2000);

    let global = function() {
        return this;
    }();
    console.log(global === window);
    // new Math();
</script>
</body>
</html>